textview: Fix blinking block cursors
authorMatthias Clasen <mclasen@redhat.com>
Sat, 13 Mar 2021 00:44:31 +0000 (19:44 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 13 Mar 2021 02:50:07 +0000 (21:50 -0500)
When we have a block cursor, we need to discard the
cached node of the line containing the cursor, in order
to get a blinking cursor.

gtk/gtktextlayout.c

index 358a92e51743f1deba269e048084cc9110bbd122..b90e6d12f1e921ff4bacd8018140921e3f489b81 100644 (file)
@@ -4236,6 +4236,13 @@ gtk_text_layout_snapshot (GtkTextLayout      *layout,
                 selection_end_index = -1;
             }
 
+          if (line_display->node != NULL)
+            {
+              if (line_display->has_block_cursor &&
+                  gtk_widget_has_focus (widget))
+                g_clear_pointer (&line_display->node, gsk_render_node_unref);
+            }
+
           if (line_display->node == NULL)
             {
               gtk_snapshot_push_collect (snapshot);